<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">	
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
<title><?=$this->short_title?></title>

<link rel="stylesheet" type="text/css" href="/styles/amazeui.css">
<link rel="stylesheet" type="text/css" href="/styles/style.css">

<script type="text/javascript" src="/scripts/jquery.js"></script>
 <!--[if (gte IE 9)|!(IE)]><!-->
<script type="text/javascript" src="/scripts/amazeui.js"></script>

<!--<![endif]-->
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>

<?php if(!$_SESSION['identity']['testmode'] && $this->signPackage):?>
<script>
wx.config({    
  	debug: false,    
      appId: "<?=$this->signPackage['appId']?>",
      timestamp: "<?=$this->signPackage['timestamp']?>",
      nonceStr: "<?=$this->signPackage['nonceStr']?>",
      signature: "<?=$this->signPackage['signature']?>", 

    jsApiList: [    
  			'checkJsApi',    
  			'onMenuShareTimeline',
  			'onMenuShareAppMessage'	    
        ]
  });

wx.ready(function(){
	wx.checkJsApi({
	      jsApiList: [
	        'getNetworkType',
	        'previewImage'
	      ],
	      success: function (res) {
	        //alert(JSON.stringify(res));
	      }
	    });


wx.onMenuShareTimeline({
      title: '<?=$this->wechat_share_title?>',
      link: '<?=$this->wechat_share_link?>',
      imgUrl: '<?=$this->wechat_share_imgUrl?>',
      trigger: function (res) {
        //alert('用户点击分享到朋友圈');
      },
      success: function (res) {
        //alert('已分享');
      },
      cancel: function (res) {
        //alert('已取消');
      },
      fail: function (res) {
        //alert(JSON.stringify(res));
      }
    });

wx.onMenuShareAppMessage({
      title: '<?=$this->wechat_share_title?>',
      desc: '<?=$this->wechat_share_desc?>',
      link: '<?=$this->wechat_share_link?>',
      imgUrl: '<?=$this->wechat_share_imgUrl?>',
	    trigger: function (res) {
        	//alert('用户点击发送给朋友');
      	},
      	success: function (res) {
        	//alert('已分享');
      	},
      	cancel: function (res) {
        	//alert('已取消');
      	},
      	fail: function (res) {
        	//alert(JSON.stringify(res));
      	}

	   });

})
</script>
<?php endif;?>

</head>

<body>

<div class="am-modal am-modal-alert" tabindex="-1" id="fq_alert">
  <div class="am-modal-dialog">
    <div class="am-modal-hd" id="fq_alert_title"></div>
    <div class="am-modal-bd" id="fq_alert_info">
    </div>
    <div class="am-modal-footer">
      <span class="am-modal-btn">确定</span>
    </div>
  </div>
</div>

<div class="am-modal am-modal-confirm" tabindex="-1" id="fq_confirm">
  <div class="am-modal-dialog">
    <div class="am-modal-hd" id="fq_confirm_title"></div>
    <div class="am-modal-bd" id="fq_confirm_info"></div>
    <div class="am-modal-footer">
      <span class="am-modal-btn" data-am-modal-confirm="">确定</span>
    </div>
  </div>
</div>


<!-- 虚拟消息框 -->

<!--悬浮图标-->
<!--悬浮图标-->




<script>
    
    function dangling(time,status){
            if(status == 1){
                $('.fq-custom').css('animation','myfirst 0.6s linear 1s infinite alternate');
            }else{
                $('.fq-custom').css('animation','none');
            }
            var t = setInterval(function(){
                if(status == 1){
                    dangling(1000,0);
                }else{
                    dangling(5000,1);
                }
                clearInterval(t);
            },time);
    }
        setTimeout(dangling(1000,0),4000);  
</script>

 
  

<link rel="stylesheet" type="text/css" href="/styles/allinone.css">
<link rel="stylesheet" type="text/css" href="/styles/grandeur.css">
<script type="text/javascript" src="/scripts/clipboard.js"></script>
<link rel="stylesheet" type="text/css" href="/styles/font_l1c96mq0nbivygb9.css">

<a href="javascript:void(0);" onclick="back();">
    <img src="/images/return.png" class="fq-return am-margin-top-sm am-margin-left-sm">
</a>
<script>
    function back(){
        var last_page_url = (document.referrer);
        if(last_page_url){
            window.history.back(-1);
        }else{
            window.location.href ='/index/index/i/<?=$this->member_id?>';
        }
    }
    $(".fq-searchbox").click(function(){
        if($(".fq-search").is(":hidden")){
            $(".fq-search").show();
            $(".fq-return").css("top","53px");
            $(".fq-searchbox").css("top","53px"); //如果元素为隐藏,则将它显现
        }else{
            $(".fq-search").hide();
            $(".fq-return").css("top","0");
            $(".fq-searchbox").css("top","0");    //如果元素为显现,则将其隐藏
        }
    })
</script>
<div class="fq-whole am-text-sm">
    <div class="fq-subject">
        <div>
            <ul data-am-widget="gallery" class="am-gallery am-avg-sm-1 am-gallery-default am-padding-0 am-no-layout">
                <li class="am-padding-0">
                    <div class="am-gallery-item">
                            <img src="<?=$this->data['pic']?>">
                    </div>
                </li>
            </ul>
            <div class="fq-grandeur-title fq-background-white am-padding-xs">
                <strong class="am-block am-text-sm"><?=$this->data['short_title']?></strong>
                <strong class="fq-price am-text-sm">券后包邮<span class="am-text-xl am-margin-left-xs"><?=$this->data['sale_price']?></span></strong>
                            </div>
            <div class="fq-grandeur-price fq-background-white am-padding-vertical-sm am-padding-horizontal-xs">
                <ul class="am-avg-sm-3 am-text-sm">
                    <li><del>在售价：<?=$this->data['original_price']?></del></li>
                    <li class="am-text-center"><i class="icon-quan2 iconfont am-margin-right-xs"></i><?=$this->data['coupon_value']?>元</li>
                    <li class="am-text-center">销量<span class="am-margin-left-xs"><?=$this->data['sale_in_30_days']?></span></li>
                </ul>
            </div>
            <div class="fq-reason fq-background-white am-padding-horizontal-xs am-padding-vertical-sm am-text-sm">
                <strong>推荐理由</strong>
                <br>
                <div class="am-margin-top-xs">
                    <?=$this->data['short_desc']?></div>
            </div>
        </div>
        <!--商品图文详情-->
        <div class="am-panel-group am-margin-vertical-sm" id="accordion">
            <div class="am-panel am-padding-horizontal-xs">
                <div class="am-panel-hd am-padding-left-0 am-padding-right-0 am-padding-vertical-sm ">
                    <h4 class="am-panel-title" data-am-collapse="{parent: '#accordion', target: '#product-details'}" data-itemid="<?=$this->data['taobao_id']?>">
                        商品图文详情<span class="am-text-xs am-text-primary">（点击展开）</span>
                        <i class="am-icon-angle-right am-fr am-icon-sm" id="change_icon"></i>
                    </h4>
                </div>
                <div id="product-details" class="am-panel-collapse am-collapse">
                    <div class="am-panel-bd am-padding-0" style="border-top: 0">
                        <div class="am-tab-panel am-fade am-in am-active" id="tab1">
                            <div class="am-padding-top-sm" style="width:100%;overflow:auto;"></div>
						</div>
                    </div>
                </div>
            </div>
        </div>
        <!--商品图文详情-->
        <div data-am-widget="gotop" class="am-gotop am-gotop-fixed am-no-layout" style="margin-bottom:50px;">
            <a href="#top">
                <i class="am-gotop-icon am-icon-chevron-up am-round"></i>
            </a>
        </div>
        <!--底部菜单-->
        <div class="fq-grandeur-menu fq-background-white">
            <ul class="am-avg-sm-2">
                <li>
                    <ul class="am-avg-sm-2 am-padding-left-xs">
                        <li>
                            <a href="/index/index/i/<?=$this->member_id?>" class="am-padding-vertical-sm am-block">
                                <i class="icon-shouye iconfont am-text-center am-vertical-align-middle"></i>
                                <span class="fq-grandeur-index am-text-sm am-text-center am-vertical-align-middle">首页</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li>
                    <ul class="am-avg-sm-2 am-text-center">
                        <li>
                            <button type="button" class="fq-browser fq-text-white am-btn am-padding-horizontal-xs am-text-sm">
								<a href="<?=$this->data['tao_token']['2in1_link']?>">浏览器购买</a>
							</button>
                        </li>
                        <li>
                            <button type="button" class="fq-amoy fq-text-white am-btn am-padding-horizontal-xs am-text-sm" data-am-modal="{target: '#doc-modal-1', closeViaDimmer: 0}">
                                淘口令购买
                            </button>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
        <!--底部菜单-->
        <div class="fq-amoy-buy am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-1">
            <div class="fq-background-white am-modal-dialog">
                <div class="am-modal-hd">
                    淘口令购买
                    <a href="javascript:void(0)" class="am-close am-close-spin" data-am-modal-close="">×</a>
                </div>
                <div class="am-modal-bd am-padding-0">
                    <!--淘口令-->
                    <!--二合一淘口令开始-->
                        <div class="am-margin-vertical am-margin-horizontal-lg">
                            <div class="fq-goods-border fq-background-white am-text-center am-margin-top am-padding-vertical am-padding-horizontal-sm">
                                <div class="fq-explain am-center am-text-center">
                                    <span class="fq-nowrap fq-text-white am-padding-horizontal-sm">长按框内 &gt; 全选 &gt; 复制</span>
                                </div>
                                <span id="copy_key_ios" style="display: none;"><?=$this->data['tao_token']['tao_token']?></span>
                                <textarea style="height: 20px; display: inline;" id="copy_key_android" type="text" class="am-form-field am-text-center am-text-sm" oninput="regain();"><?=$this->data['tao_token']['tao_token']?></textarea>
                            </div>
                        </div>
                        <!--二合一淘口令结束-->
                                            <div class="copy_taowords am-margin-bottom" style="display:none;">
                        
                        <div class="am-text-center am-margin-top-sm">
                             <div class="share_content am-margin-bottom am-badge-success am-badge"></div>
                            <a class="share am-padding-vertical-xs am-padding-horizontal-lg am-round am-inline-block" data-taowords="<?=$this->data['tao_token']['tao_token']?>">
                                一键复制
                            </a>
                            <div class="am-margin-top-sm am-text-xs am-text-primary am-margin-horizontal-sm">点击复制后，请打开【手机淘宝】购买！</div>
                        </div>
                    </div>
                    <div class="fq-instructions am-text-left am-text-xs am-padding-vertical-sm am-padding-horizontal-lg">
                        <span>
                            <span>使用说明：</span>
                            <span>复制淘口令后打开【手机淘宝】即可领取优惠券购买！</span>
                        </span>
                        <br>
                        <span>
                            <span>温馨提示：</span>
                            手机无【手机淘宝】者，可选择浏览器购买方式哦~
                        </span>
                    </div>
                </div>
            </div>
        </div>
        <div class="copy_taoword_content am-margin-bottom am-badge-success am-badge" id="copy_taoword_content"></div>
        <div class="fq-service-wechat am-modal am-modal-no-btn" tabindex="-1" id="qrcode_large">
            <div class="am-modal-dialog">
                <div class="am-modal-hd">
                    <span class="am-text-sm">点击二维码放大后长按关注</span>
                    <a href="javascript:%20void(0)" class="am-close" data-am-modal-close="">×</a>
                </div>
                <ul data-am-widget="gallery" class="am-gallery am-avg-sm-1 am-gallery-default am-no-layout">
                    <li>
                        <div class="am-gallery-item">
                            <img src="cms2_files/FhiHuej1byL3DBO5-u2NsXbZJyIW-310x310.jpg" alt="">
                                <span class="am-text-xs am-text-danger" style="top: -2px;position: relative;">客服微信</span>                        </div>
                                            </li>
                </ul>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {
        //事件监听
        //------------------------------------------
        var ua = navigator.userAgent.toLowerCase();
        if (ua.match(/iphone os 10/i) == "iphone os 10") {
            $('.fq-amoy-buy .copy_taowords').show();
            var clipboard = new Clipboard('.share', {
                target: function() {
                                    
                    return document.querySelector('.copy_taoword_content');
                }
            });
            clipboard.on('success', function(e){
                e.trigger.innerHTML="已复制";
                e.trigger.style.backgroundColor="#9ED29E";
                e.trigger.style.borderColor="#9ED29E";
                //var conpycontent=$(".share_content").html();
                //console.log(conpycontent);
               $(".copy_taoword_content").html('');
                console.info('Action:', e.action);
                console.info('Text:', e.text);
                console.info('Trigger:', e.trigger);
                e.clearSelection();
            });
            clipboard.on('error', function(e) {
                $(".copy_taoword_content").html('');
                $("#fq_alert_info").html("<div class=\"am-text-danger\">由于您的浏览器不兼容或当前网速较慢，复制失败，请手动复制或更换主流浏览器！</div><div class=\"am-margin\" style=\"text-align: left;\">"+$(".copy_taoword_content").html()+"</div>");
                $('#fq_alert').modal();
            });
            if('' == 1){
                //复制推广
                var clipboard_select = new Clipboard('.share_generalize', {
                    target: function(trigger) {
                        return document.querySelector('.agent_content');
                    }
                });

                clipboard_select.on('success', function(e){
                    $(".agent_content").hide();
                    e.trigger.innerHTML="已复制";
                    e.trigger.style.backgroundColor="#9ED29E";
                    e.trigger.style.borderColor="#9ED29E";
                    e.clearSelection();
                });

                clipboard_select.on('error', function(e) {
                    $(".agent_content").hide();
                    $("#fq_alert_info").html("<div class=\"am-text-danger\">由于您的浏览器不兼容或当前网速较慢，复制失败，请手动复制或更换主流浏览器！</div>");
                    $('#fq_alert').modal();
                    $(".agent_content").html('');
                });
            }
        }
        document.addEventListener("selectionchange", function (e) {
            if (window.getSelection().anchorNode.parentNode.id == 'copy_key_ios' && document.getElementById('copy_key_ios').innerText != window.getSelection()) {
                var key = document.getElementById('copy_key_ios');
                window.getSelection().selectAllChildren(key);
            }
            if (window.getSelection().anchorNode.parentNode.id == 'copy_key_ios1' && document.getElementById('copy_key_ios1').innerText != window.getSelection()) {
                var key = document.getElementById('copy_key_ios1');
                window.getSelection().selectAllChildren(key);
            }
            if (window.getSelection().anchorNode.parentNode.id == 'copy_key_ios2' && document.getElementById('copy_key_ios2').innerText != window.getSelection()) {
                var key = document.getElementById('copy_key_ios2');
                window.getSelection().selectAllChildren(key);
            }
            if (window.getSelection().anchorNode.parentNode.id == 'copy_key_ios3' && document.getElementById('copy_key_ios3').innerText != window.getSelection()) {
                var key = document.getElementById('copy_key_ios3');
                window.getSelection().selectAllChildren(key);
            }
            if (window.getSelection().anchorNode.parentNode.id == 'copy_key_ios4' && document.getElementById('copy_key_ios4').innerText != window.getSelection()) {
                var key = document.getElementById('copy_key_ios4');
                window.getSelection().selectAllChildren(key);
            }
            if (window.getSelection().anchorNode.parentNode.id == 'copy_key_ios5' && document.getElementById('copy_key_ios5').innerText != window.getSelection()) {
                var key = document.getElementById('copy_key_ios5');
                window.getSelection().selectAllChildren(key);
            }
        }, false);
    });
    document.addEventListener("selectionchange", function (e) {
        if (window.getSelection().anchorNode.parentNode.id == 'copy_key_ios' && document.getElementById('copy_key_ios').innerText != window.getSelection()) {
            var key = document.getElementById('copy_key_ios');
            window.getSelection().selectAllChildren(key);
        }
        if (window.getSelection().anchorNode.parentNode.id == 'copy_key_ios1' && document.getElementById('copy_key_ios1').innerText != window.getSelection()) {
            var key = document.getElementById('copy_key_ios1');
            window.getSelection().selectAllChildren(key);
        }
        if (window.getSelection().anchorNode.parentNode.id == 'copy_key_ios2' && document.getElementById('copy_key_ios2').innerText != window.getSelection()) {
            var key = document.getElementById('copy_key_ios2');
            window.getSelection().selectAllChildren(key);
        }
        if (window.getSelection().anchorNode.parentNode.id == 'copy_key_ios3' && document.getElementById('copy_key_ios3').innerText != window.getSelection()) {
            var key = document.getElementById('copy_key_ios3');
            window.getSelection().selectAllChildren(key);
        }
        if (window.getSelection().anchorNode.parentNode.id == 'copy_key_ios4' && document.getElementById('copy_key_ios4').innerText != window.getSelection()) {
            var key = document.getElementById('copy_key_ios4');
            window.getSelection().selectAllChildren(key);
        }
        if (window.getSelection().anchorNode.parentNode.id == 'copy_key_ios5' && document.getElementById('copy_key_ios5').innerText != window.getSelection()) {
            var key = document.getElementById('copy_key_ios5');
            window.getSelection().selectAllChildren(key);
        }
    }, false);

    var ua = navigator.userAgent.toLowerCase();
    if (ua.match(/iphone/i) == "iphone" || ua.match(/ipad/i) == "ipad") {

        $('.fq-explain span').html("请点击下方按钮进行复制");

    } else {
        $("#copy_key_ios").hide();
        $("#copy_key_ios1").hide();
        $("#copy_key_ios2").hide();
        $("#copy_key_ios3").hide();
        $("#copy_key_ios4").hide();
        $('#copy_key_ios5').hide();
        $("#copy_key_android").show();
        $("#copy_key_android1").show();
        $("#copy_key_android2").show();
        $("#copy_key_android3").show();
        $("#copy_key_android4").show();
        $("#copy_key_android5").show();
    }
    $(".fq-amoy-buy .share").on('click', function() {
        var taowords = $(this).attr('data-taowords');
        console.log(taowords);
        $('.copy_taoword_content').html(taowords);
    })


    //获取宝贝详情
    $('.am-panel-title').click(function () {
        //详情显影
        if ($("#product-details").is(":hidden")) {
            $("#change_icon").removeClass('am-icon-angle-right').addClass('am-icon-angle-down');
            $('.am-tab-panel').html('<span class="am-center am-text-center am-margin-vertical-xs">图片努力加载中<i class="am-icon-spinner am-icon-pulse am-margin-left-xs"></i></span>');
        } else {
            $("#change_icon").removeClass('am-icon-angle-down').addClass('am-icon-angle-right');
        }
        var itemid = $(this).attr('data-itemid');
        getiteminfo(itemid);
    });
    //采集宝贝详情的图片内容
    function getiteminfo(itemid) {
        $.ajax({
            url: "https://hws.m.taobao.com/cache/mtop.wdetail.getItemDescx/4.1/?data=%7Bitem_num_id%3A" + itemid + "%7D&type=jsonp&dataType=jsonp",
            dataType: 'jsonp',
            jsonp: 'callback',
            success: function (result) {
                if (result.ret[0] == "SUCCESS::接口调用成功") {
                    var len = result.data.images.length;
                    var image = new Array();
                    for (var i = 0; i < len; i++) {
                        image[i] = '<img src="' + result.data.images[i] + '">';
                    }
                    $('.am-tab-panel').html(image);
                } else {
                    $("#qf_alert_info").html("宝贝数据调用失败，原因：" + result.ret[0]);
                    $('#qf_alert').modal();
                }
            }
        });
    }
</script>
<script>
    if(document.getElementById("copy_key_android")){
        var taokouling_value = document.getElementById("copy_key_android").value;
        function regain() {
            document.getElementById('copy_key_android').value = taokouling_value;
        }
    }
    if(document.getElementById("copy_key_android1")){
        var taokouling_value1 = document.getElementById("copy_key_android1").value;
        function regain1() {
            document.getElementById('copy_key_android1').value = taokouling_value1;
        }
    }
    if(document.getElementById("copy_key_android2")){
        var taokouling_value2 = document.getElementById("copy_key_android2").value;
        function regain2() {
            document.getElementById('copy_key_android2').value = taokouling_value2;
        }
    }
    if(document.getElementById("copy_key_android3")){
        var taokouling_value3 = document.getElementById("copy_key_android3").value;
        function regain3() {
            document.getElementById('copy_key_android3').value = taokouling_value3;
        }
    }
    if(document.getElementById("copy_key_android4")){
        var taokouling_value4 = document.getElementById("copy_key_android4").value;
        function regain4() {
            document.getElementById('copy_key_android4').value = taokouling_value4;
        }
    }
    if(document.getElementById("copy_key_android5")){
        var taokouling_value5 = document.getElementById("copy_key_android5").value;
        function regain5() {
            document.getElementById('copy_key_android5').value = taokouling_value4;
        }
    }
</script>

<script>
    function post(URL, PARAMS) {
        var temp = document.createElement("form");
        temp.action = URL;
        temp.method = "post";
        temp.style.display = "none";
        for (var x in PARAMS) {
            var opt = document.createElement("textarea");
            opt.name = x;
            opt.value = PARAMS[x];
            temp.appendChild(opt);
        }
        document.body.appendChild(temp);
        temp.submit();
        return temp;
    }


    $(function(){
        $('.share_btn').on('click', function() {
            post('/index/details'+'/id/'+$(this).data('id'), {share:true});
        });
        if('' == 1){
            $('#js_generalize').click(function(){
                var url = 'https://uland.taobao.com/coupon/edetail?';
                if('18c37432d51c406093621deacc9e3071'){
                    url += 'activityId=18c37432d51c406093621deacc9e3071';
                    var activityid = '18c37432d51c406093621deacc9e3071';
                }else{
                    var activityid = 0;
                }
                url += '&pid=&itemId=546070090644&src=fklm_hltk';
                if('鹊桥活动' == '定向计划'){
                    url += '&dx=1';
                }
                var title = 'MOXA WING春秋新款女装耸肩修身显瘦外套女装格子上衣补丁西服';
                var item_id = '546070090644';
                var pid = '';
               
                $.ajax({
                    type:'post',
                    url:"/Index/api_get_url_taowords",
                    data:{'url':url,'title':title,'item_id':item_id,'pid':pid,'activityid':activityid}
                }).done(function(res){
                    if(res.status == 1){
                        var content = '【商品】MOXA WING春秋新款女装耸肩修身显瘦外套女装格子上衣补丁西服\n';
                        if('18c37432d51c406093621deacc9e3071'){
                            content += '【优惠券】80\n【价格】129.00 领券后【49.00】2017春新款，韩版复古，经典格子，修身显瘦，补丁时尚，椭圆衣摆，简洁大方。\n';
                        }else{
                            content += '【价格】129.00 2017春新款，韩版复古，经典格子，修身显瘦，补丁时尚，椭圆衣摆，简洁大方。 ';
                        }
                        content += '——————\n【商品领券下单】：长按复制这条信息，打开【手机淘宝】可领券并下单'+res.info;
                        var ua = navigator.userAgent.toLowerCase();
                        if(ua.match(/iphone/i) == "iphone" || ua.match(/ipad/i) == "ipad"){
                            content =  content.replace(/\n/g,'<br>');
                            $('.share_generalize').attr('data-content',content);
                            $('#copy_key_ios5').html(content);
                        }else{
                            $('#copy_key_android5').val(content).show();
                        }

                        $('#fq-promotion-message').modal({closeViaDimmer:0})
                    }else{
                        $('#fq-promotion-message').modal('close');
                        $('#fq_alert_info').text(res.info);
                        $('#fq_alert').modal({});
                        return;
                    }
                }).fail(function(){
                    $('#fq-promotion-message').modal('close');
                    $('#fq_alert_info').text('淘口令生成失败，请重试');
                    $('#fq_alert').modal({});
                    return;
                });
            });
        }

    });
    function search(){
        var key = $('#key').val();
        window.location.href="/index/index/sort/8/key/"+key;
    }
    $('.share_generalize').click(function(){
        var data_content=$('.share_generalize').attr('data-content');
        $('.agent_content').html(data_content);
    });
</script>
<div class="am-text-xs am-text-center am-margin-vertical-sm">
        便捷猫 ©版权所有
    </div>
</div>
</body>